-- card: 6661 from stack: in -- bmap block id: 0 -- flags: 0000 -- background id: 2795 -- name: RenameFile -- part contents for background part 1 ----- text ----- XFCN -- part contents for background part 22 ----- text ----- RenameFile("OldName","NewName") -- part contents for background part 13 ----- text ----- • RenameFile("OldName","NewName"). This renames a file, keeping it in the same folder (or at the root of the volume). "OldName" is a full pathname, and "NewName" is a replacement for the last component of that path. For instance: put RenameFile("HD:Telecom:capture","session") into err will produce a file called "HD:Telecom:session" if it succeeds. 0 is returned on success, a negative number for an Operating System error, and 1 for a parameter error. See the OsErr handler in the stack script for a suggestion on how to handle this. -- OsErr: for displaying Operating system error codes returned by -- Sublaunch, RenameFile, MoveFile and DeleteFile XFCNs. on OsErr err -- Translate the most common ones if err > 0 then -- XFCN convention put "Parameter error with function" into errstr else if err is -59 then put "Problem during rename" into errstr else if err is -54 then put "Attempt to open locked file for writing" into errstr else if err is -46 then put "Volume locked by software" into errstr else if err is -45 then put "File locked" into errstr else if err is -44 then put "Volume locked by hardware" into errstr else if err is -43 then put "File not found" into errstr else if err is -37 then put "Bad volume or file name" into errstr else if err is -36 then put "I/O error" into errstr else if err is -35 then put "No such volume" into errstr else if err is -34 then put "Disk is full" into errstr else if err is -49 then put "File already open for writing" into errstr else put "Failed with error" && err into errstr end if answer errstr with "OK" end OsErr